#ifndef __EVENT_RECEIVER_PROXY_H_INCLUDED__
#define __EVENT_RECEIVER_PROXY_H_INCLUDED__
	
typedef bool (__cdecl *eventCB)(const SEvent& myevent);

bool (__cdecl *eventCBPointer)(const SEvent& myevent) = NULL;

extern "C" __declspec(dllexport) bool initCallBack(eventCB eventcb)
{
	eventCBPointer = eventcb;
	
	return true;
}

namespace irr
{
namespace gui
{
class EventReceiverProxy : public IEventReceiver
{
public:
	~EventReceiverProxy() {}

	//! Called if an event happened.
	/** Please take care that you should only return 'true' when you want to _prevent_ Irrlicht
	* from processing the event any further. So 'true' does mean that an event is completely done.
	* Therefore your return value for all unprocessed events should be 'false'.
	\return True if the event was processed.
	*/
	bool OnEvent(const SEvent& myevent)
	{
		bool value = false;

		if (eventCBPointer)
		{
			value = eventCBPointer(myevent);
		}
		else
		{
			value = false;
		}

		return value;
	}
};
} // end namespace gui
} // end namespace irr

#endif